package com.dianban.service.impl;


import com.dianban.dao.FacePayStoreOrderShareLogDao;
import com.dianban.entity.FacePayStoreOrderShareLog;
import com.dianban.service.FacePayStoreOrderShareLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true)
public class FacePayStoreOrderShareLogServiceImpl implements FacePayStoreOrderShareLogService {

    @Autowired
    private FacePayStoreOrderShareLogDao facePayStoreOrderShareLogDao;

    @Override
    public FacePayStoreOrderShareLog findById(Long id) {
        return facePayStoreOrderShareLogDao.findById(id);
    }

    @Override
    public FacePayStoreOrderShareLog findByCode(String code) {
        return facePayStoreOrderShareLogDao.findByCode(code);
    }

    @Override
    @Transactional(readOnly = false)
    public int insert(FacePayStoreOrderShareLog facePayStoreOrderShareLog) {
        facePayStoreOrderShareLog.setCreatetime(System.currentTimeMillis() / 1000);
        return facePayStoreOrderShareLogDao.insert(facePayStoreOrderShareLog);
    }

    @Override
    @Transactional(readOnly = false)
    public void update(Long id, String status, Long userId, Long getUserId) {
        Long updatetime = System.currentTimeMillis() / 1000;
        facePayStoreOrderShareLogDao.update(id, status, userId, getUserId, updatetime);
    }

    @Override
    public List<FacePayStoreOrderShareLog> findList(String status, Long userId, Long getUserId) {
        return facePayStoreOrderShareLogDao.findList(status, userId, getUserId);
    }

}
